package com.zhaopin.file;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.List;

/**
 * @author Administrator
 * @create 2019-10-12 18:31
 */
public class FileSchoolCompare {

    public static void main(String[] args) throws IOException {
        List<String> listKg = FileUtils.readLines(new File("e:\\data\\KG院校名单1.txt"), StandardCharsets.UTF_8);
        List<String> listMe = FileUtils.readLines(new File("e:\\data\\schoolName.txt"), StandardCharsets.UTF_8);
        PrintWriter pw = new PrintWriter(new File("e:\\data\\KG院校名单1-schoolName.txt"));
        PrintWriter pw2 = new PrintWriter(new File("e:\\data\\schoolName-KG院校名单1.txt"));
        for (String s : listKg) {
            if(!listMe.contains(s)){
                pw.println(s);
            }
        }

        for (String s : listMe) {
            if(!listKg.contains(s)){
                pw2.println(s);
            }
        }
        pw.flush();
        pw.close();
        pw2.flush();
        pw2.close();
    }
}
